<ion-view title="云">
  <ion-content class="stable-bg">
    <div ng-if="account" class="item item-avatar" style="margin-top:20px">
      <img src="assets/user.png">

      <h2>{{account.username}}</h2>
      <span>{{account.email}}</span>
    </div>
    <label ng-if="account" class="item item-toggle" style="margin-top:20px">
      自动同步
      <label class="toggle">
        <input type="checkbox">

        <div class="track">
          <div class="handle"></div>
        </div>
      </label>
    </label>
    <label ng-if="account" class="item padding-vertical">
      <button class="button button-clear button-full"
         style="text-align: left;margin: 0px;padding: 0px;color: blue;font-weight: bold" ng-click="loadFromCloud()">即时与云端进行同步</button>
    </label>

    <label ng-if="account" class="item" style="margin-top: 20px;padding: 0px" ng-click="show()">
      <a class="button button-clear button-full"
         style="margin:0px;padding: 0px;color: orange;font-weight: bold">注销</a>
    </label>

    <form ng-if="!account" name="loginForm" novalidate>
      <div class="item item-avatar" style="margin-top:20px">
        <img style="margin-top: 20px" src="assets/user.png">
        <input ng-init="username" name="username" ng-model="username" class="form-control" type="text" placeholder="必填" required />
        <hr style="border: solid 1px lavender;height: 0px"/>
        <input name="password" ng-model="password" class="form-control" type="password" placeholder="必填" required />
      </div>
      <label ng-if="!account" class="item" style="margin-top: 20px;padding: 0px 0px 0px 20px">
        <button class="button button-clear button-full" ng-disabled="!loginForm.$valid" ng-click="login(username,password)"
           style="text-align: left">登录</button>
      </label>
    </form>

  </ion-content>
</ion-view>
